﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using PPAP.DAO;
using PPAP.Model;

namespace PPAP.BO
{
    public class LogBO
    {
        public LogBO() { }

        LogDAO dao = new LogDAO();

        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(Log model)
        {
            return dao.Add(model);
        }
        /// <summary>
        /// 更新一条数据
        /// </summary>
        public int Update(Log model)
        {
           return dao.Update(model);
        }

        /// <summary>
        /// 删除一条数据
        /// </summary>
        public int Delete(int id)
        {
            return dao.Delete(id);
        }


        /// <summary>
        /// 得到一个对象实体
        /// </summary>
        public Log GetModel(int id)
        {
            return dao.GetModel(id);
        }

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public DataSet GetList(string strWhere)
        {
          return  dao.GetList(strWhere);
        }

        /// <summary>
        /// 写入日志
        /// </summary>
        /// <param name="username">操作人</param>
        /// <param name="action">操作内容</param>
        /// <returns></returns>
        public int WriteLog(string username, string action)
        {
            return dao.WriteLog(username, action);
        }

        /// <summary>
        /// 写入日志
        /// </summary>
        /// <param name="username">操作人</param>
        /// <param name="action">操作内容</param>
        /// <param name="RID">PPARID</param>
        /// <returns></returns>
        public int WriteLog(string username, string action, string RID)
        {
           return dao.WriteLog(username, action, RID);
        }

        public DataSet GetReport(string sqlwhere,string sqlwhere2)
        {
            return dao.GetReport(sqlwhere,sqlwhere2);
        }

        /// <summary>
        /// refused
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport1(string date1, string date2)
        {
            return dao.GetReport1(date1, date2);
        }

        /// <summary>
        /// condtionally approved
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport2(string date1, string date2)
        {
            return dao.GetReport2(date1, date2);
        }

        /// <summary>
        /// apprvoed
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport3(string date1, string date2)
        {
            return dao.GetReport3(date1, date2);
        }

        /// <summary>
        /// no. of parts arrived for inspection
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport4(string date1, string date2)
        {
            return dao.GetReport4(date1, date2);
        }

        /// <summary>
        /// no. of inspections started
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport5(string date1, string date2)
        {
            return dao.GetReport5(date1, date2);
        }

        /// <summary>
        /// no. of inspections finished
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport6(string date1, string date2)
        {
            return dao.GetReport6(date1, date2);
        }

        /// <summary>
        /// planned no. of inspection finished
        /// </summary>
        /// <param name="date1"></param>
        /// <param name="date2"></param>
        /// <returns></returns>
        public DataSet GetReport7(string date1, string date2)
        {
            return dao.GetReport7(date1, date2);
        }

        /// <summary>
        /// InspectionReport
        /// </summary>
        /// <returns></returns>
        public DataSet GetReportSum()
        {
            return dao.GetReportSum();
        }

        /// <summary>
        /// InspectionReport 指定时间
        /// </summary>
        /// <returns></returns>
        public DataSet GetReportSum(string date1, string date2)
        {
            return dao.GetReportSum(date1, date2);
        }

        /// <summary>
        /// DistributionReport 指定时间
        /// </summary>
        /// <returns></returns>
        public DataSet GetReportForDistribution(string date1, string date2, string qe)
        {
            return dao.GetReportForDistribution(date1, date2, qe);
        }

    }
}
